if(1)
  [H, RhoExact] = CreateRho( 1000 );
  nLevel = 6;
  [DiagVec, DiagBlock] = ConstructHMatrix( RhoExact, nLevel );
end

err = abs(DiagVec - diag( RhoExact )) ./ abs(DiagVec);
max(err)

% if( isInvKernel )
  % display('Checking diagonal blocks');
  % nSample = 2^nLevel;
  % nList = nx / nSample;
  % nWidthCur = nList / 2;
  % Err2 = zeros( nSample, 1 );
  % for i = 1 : nSample * 2
    % Err2(i) = norm( DiagBlock{i} - invKernel( ...
      % 1+(i-1)*nWidthCur : i * nWidthCur, ...
      % 1+(i-1)*nWidthCur : i * nWidthCur ) );
    % Err2(i)
  % end
% end



